package mapper;

/**
 * service 用于封装server.xml 中的service节点
 */
public class Service {

    /**
     * service名称，localhost:8080
     */
    private String name;

    /**
     * 端口
     */
    private Connector connector;

    /**
     * 主机
     */
    private Host host;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Connector getConnector() {
        return connector;
    }

    public void setConnector(Connector connector) {
        this.connector = connector;
    }

    public Host getHost() {
        return host;
    }

    public void setHost(Host host) {
        this.host = host;
    }

    public Service(Host host, Connector connector) {
        this.name = host.getName()+":"+connector.getPort();
        this.connector = connector;
        this.host = host;
    }
}
